<template>
  <dtDialog
    title="日志详情"
    :visible.sync="dialogVisible"
    :footer-slot="true"
  >
    <el-form
      slot="content"
      :model="form"
      disabled
      label-position="right"
      label-width="72px"
    >
      <el-form-item label="日志编号">
        <el-input v-model.trim="form.ltgCode" />
      </el-form-item>
      <el-form-item label="任务名称">
        <el-input v-model.trim="form.timerName" />
      </el-form-item>
      <el-form-item label="执行状态">
        <el-input v-model.trim="form.status " />
      </el-form-item>
      <el-form-item label="开始时间">
        <el-input v-model.trim="form.jobBeginTime" />
      </el-form-item>
      <el-form-item label="结束时间">
        <el-input v-model.trim="form.jobEndTime" />
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model.trim="form.exception" />
      </el-form-item>
    </el-form>
  </dtDialog>
</template>
<script>
import taskLogApi from '@/framework/api/taskLog'

export default {
  data() {
    return {
      dialogVisible: false,
      form: {},
      log: {}
    }
  },
  methods: {
    openDialog(row) {
      this.dialogVisible = true
      taskLogApi.getDetail({ ltgId: row.ltgId }).then((resp) => {
        this.form = resp.data
        const arr = []
        this.$parent.options.forEach((res) => {
          if (res.dictCode == row.status) {
            arr.push(res.dictName)
          }
        })
        this.form.status = arr.join(',')
      })
    }
  }
}
</script>
